
struct node{
  struct node *left;
  struct node *right;
  int data;
};

typedef struct node *nptr;

nptr create_list(){
  nptr new_list = malloc(sizeof(new_list));
  new_list->data = -1;
  new_list->right = new_list;
  new_list->left = new_list;
  return new_list;
}
nptr insert_r(nptr list,int data){
  nptr new_list = malloc(sizeof(new_list));
  new_list->data = data;
  new_list->left = list;
  new_list->right = list->right;
  list->right = new_list;
  new_list->right->left = new_list;
  return new_list;
}
nptr del(nptr list){
  list->right->left = list->left;
  list->left->right = list->right;
  return list->left;
}
void print_all(nptr list){
  nptr head = list;
  nptr cur = list;
  while(head != (cur = cur->right)) printf("%d",cur->data);
  printf("\n");
}
